package com.Lubaichen.Wiki.config;

import org.mybatis.spring.annotation.MapperScan;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.context.annotation.ComponentScan;
import org.springframework.core.env.Environment;
import org.springframework.scheduling.annotation.EnableAsync;
import org.springframework.scheduling.annotation.EnableScheduling;

@ComponentScan("com.Lubaichen") // alt + enter 把Lubaichen加到字典里，就不会有波浪号了
// 上面这个注解也可以扫描多个，写成 {"com.Lubaichen", "com.test"}
@SpringBootApplication
@MapperScan("com.Lubaichen.Wiki.mapper")
@EnableScheduling
@EnableAsync
public class WikiApplication {
	// 404: 请求访问不到，没有这样的一个接口。
	private static final Logger LOG = LoggerFactory.getLogger(WikiApplication.class);
	public static void main(String[] args) {
		SpringApplication app = new SpringApplication(WikiApplication.class);
		Environment environment = app.run(args).getEnvironment();
		LOG.info("启动成功！！");
		LOG.info("地址:\thttp://localhost:{}", environment.getProperty("server.port"));
	}

}
